namespace KinonekoSoftware.Extensions.Strings.Patterns
{
    public static partial class StringStatic
    {
        public static string TakeUntil(this string raw, int length)
        {
            if (string.IsNullOrEmpty(raw))
            {
                return string.Empty;
            }
            
            
            var min = Math.Min(raw.Length, length);
            return raw.Substring(min);
        }
        
        public static string TakeUntil(this string raw, int offset, int length)
        {
            if (string.IsNullOrEmpty(raw))
            {
                return string.Empty;
            }
            
            
            var min = Math.Min(raw.Length, length);
            return raw.Substring(offset, min);
        }
    }
}